<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ page import="com.yaodian100.core.common.utils.ServerValue"%>
<%@ include file="/taglibs.jsp"%> 	
<script src="/js/grid.locale-en.js" type="text/javascript"></script>
<script src="/js/jquery.jqGrid.min.js" type="text/javascript" charset="UTF-8"></script>
<s:url var="supplierPops" value="/json/supplierPops.do?id=member"/>
<s:url var="brandPops" value="/json/brandPops.do"/>
<link rel="stylesheet" type="text/css" media="screen" href="/css/ui.jqgrid.css" />
<link href="/css/jquery-ui-1.7.2.custom.css" rel="stylesheet" type="text/css" media="screen" />
<link href="/css/ddaccordion.css" rel="stylesheet" type="text/css" media="screen" />
<link rel="stylesheet" href="/css/jquery.tooltip.css" />
<script src="/js/jquery.tooltip.min.js" type="text/javascript"></script>
<script language="javascript">
var content;
var qry_target = '01';
$().ready(function(){
$("tr[id*='tdDesc_']").tooltip();
$("#cbAll").click(function(){
		$(":input[id*=cb_]").attr('checked',$("#cbAll").attr('checked'));
	});

$("#getSupplier").click(function() {
	//qry_target = 'member';
	doAR('${supplierPops}', 'dialog'); 
	openDialog('供应商搜寻',content, 550, 440);
});
$("#getBrand").click(function() {
	doAR('${brandPops}', 'dialog'); 
	openDialog('品牌搜寻',content, 550, 440);
});	
});
</script>
<font color="red"><s:actionerror /></font>
<s:actionmessage />
<s:fielderror />
<h1>提报商品审核</h1>
<div class="data-form"><s:form action="list.do" method="post">
	<b>批次编号：</b>
	<input name="proposeProductBatchIdParam" id="proposeProductBatchIdParam" type="text" title="批次编号" size="30"
		value="${proposeProductBatchIdParam}">	
	<b>商品编号：</b>
	<input name="productIdParam" id="productIdParam" type="text" title="商品编号" size="30"
		value="${productIdParam}">	
	<b>审核状态：</b>
	<select id="proposeStatus" name="proposeStatus"/>
		<option value="0" ${proposeStatus=='0' ? 'selected': ''}>未审核</option>
		<option value="1" ${proposeStatus=='1' ? 'selected': ''}>已审核</option>
		<option value="X" ${proposeStatus=='X' ? 'selected': ''}>已删除</option>		
	</select>
	
	<br/>
	<b>供应商编号：</b>
	<s:textfield name="supplierIdParam" id="supplierIdParam"/>
	<img class="ui-icon ui-icon-search" src="/images/none.gif" style="height:16px; width:16px; position:relative; display:inline;" 
		id="getSupplier"/>
	<b>品牌编号：</b> 
	<s:textfield name="brandParam" id="brandIdParam" />
	<img class="ui-icon ui-icon-search" src="/images/none.gif" style="height:16px; width:16px; position:relative; display:inline;" 
		id="getBrand"/>
	<input type="button" value="搜寻" onclick="this.form.submit();" />
</s:form>
</div>
<br/>
<s:form action="aprvProduct.do" method="post" id="productForm">
<table class="tb-1" width="100%">
	<thead>
		<tr>
        	<th><input type="checkbox" id="cbAll" /></th>
			<th>审核状态</th>
			<th>商品编号</th>
			<th>商品名称</th>
			<th>批次编号</th>
			<th>编辑商品</th>
			<th>编辑商品规格</th>
			<th>上传图档</th>
		</tr>
	</thead>
	<tbody>			 		 
            <c-rt:forEach items="${proposeProducts}" var="product" varStatus="rows_index"> 
			<tr class="${rows_index.count % 2 == 0 ? 'bg-yl' : ''}" id="tdDesc_${rows_index.count}" title="建立者:${product.createUser} 建立日期:${product.createDate}<br/>修改者:${product.modifyUser} 修改日期:${product.modifyDate}">
				<td>
				<c:if test="${product.status=='0'}"><input name="approvePrdt" type="checkbox" value="${product.id}" id="cb_${rows_index.count}"/></c:if>
				</td>
				<td>
				<c:choose>
					<c:when test="${product.isDelete=='Y'}">已删除</c:when>
					<c:otherwise>
						<c:if test="${product.status=='0'}">未审核</c:if>
						<c:if test="${product.status=='1'}">已审核</c:if>
					</c:otherwise>
				</c:choose>
				</td>
				<td>${product.id}</td>
				<td style="text-align:left;">${product.name}</td>
				<td>${product.proposeProductBatchId}</td>
				<td><c:if test="${product.status=='0'}"><a href="edit.do?productId=${product.id}" />编辑</a></c:if></td>
				<td><c:if test="${product.status=='0'}"><a href="spec.do?productId=${product.id}" />编辑</a></c:if></td>
				<td><c:if test="${product.status=='0'}"><a href="<%=ServerValue.getMidContextPath()%>/image/editPropose.do?productId=${product.id}" />上传</a></c:if></td>
			</tr>
		</c-rt:forEach>
		
	</tbody>
</table>
<br />
<c:if test="${proposeStatus != '1'}">
<select id="batchAction" name="batchAction"/>
	<c:if test="${proposeStatus == '0'}"><option value="approve">批次审核</option></c:if>
	<c:if test="${proposeStatus == '0'}"><option value="delete">批次删除</option></c:if>
	<c:if test="${proposeStatus == 'X'}"><option value="unapprove">转为未审核</option></c:if>		
</select>
<input type="submit" value="批次作业"/>
</c:if>

<yaodian100:pageutil link="list.do?proposeStatus=${proposeStatus}&proposeProductBatchIdParam=${proposeProductBatchIdParam}&productIdParam=${productIdParam}" pagerObj="${pager}"  />
</s:form> 	